#ifndef CONVOLUTIONAL_LAYER_H
#define CONVOLUTIONAL_LAYER_H
#include "cform.h"

typedef layer convolutional_layer;

convolutional_layer make_convolutional_layer(int batch, int h, int w, int c, int n, int groups, 
    int size, int stride, int padding, ACTIVATION activation, int batch_normalize, int binary, int xnor, int adam);

void resize_convolutional_layer(convolutional_layer l, network net);

void forward_convolutional_layer(convolutional_layer l, network net);

void update_convolutional_layer(convolutional_layer l, update_args arg);

void update_convolutional_adam_layer(convolutional_layer l, update_args arg);

void backward_convolutional_layer(convolutional_layer l, network net);

void add_bias(float *output, float *biases, int batch, int n, int size);

void backward_bias(float *bias_updates, float *delta, int batch, int n, int size);

int convolutional_out_height(convolutional_layer layer);

int convolutional_out_width(convolutional_layer layer);

static size_t get_workspace_size(layer l) {
    return (size_t)l.out_h*l.out_w*l.size*l.size*l.c/l.groups*sizeof(float);
}

#ifdef GPU

#endif // GPU

#endif // CONVOLUTIONAL_LAYER_H